package com.kandroid.designpattern.state.demo1;

public class Main {

    public static void main(String[] args) {
        ATM atm = new ATM();

        atm.printState();

        print("=======无卡状态下插入银行卡========");
        atm.insertBankCard();
        atm.printState();

        print("\n=======有卡状态下再次插入卡========");
        atm.insertBankCard();
        atm.printState();

        print("\n=======有卡状态输入密码========");
        atm.inputPassword();
        atm.inputMoney(100);
        atm.tapOkButton();
        atm.printState();

        print("\n=======取款后再次输入密码进行提款========");
        atm.inputPassword();
        atm.inputMoney(100000);
        atm.tapOkButton();
        atm.printState();

        print("\n=======退卡========");
        atm.backBankCard();
        atm.printState();

        print("\n====无卡时调用输入密码操作=====");
        atm.inputPassword();
        atm.printState();
    }

    private static void print(String msg) {
        System.out.println(msg);
    }
}
